﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:RubricaSentimentale" 
    x:Class="RubricaSentimentale.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="0.101*" />
            <RowDefinition Height="0.098*" />
            <RowDefinition Height="0.802*"/>
        </Grid.RowDefinitions>
        <!--TitlePanel contains the name of the application and page title-->
        <!--ContentPanel - place additional content here-->
        <TextBlock x:Name="textBlock1" Text="Lista Contatti" FontSize="48" TextAlignment="Center" />
        <ListBox ItemsSource="{Binding DisplayList}" HorizontalContentAlignment="Stretch" d:LayoutOverrides="Width, Height" Grid.Row="2">
        	<ListBox.ItemTemplate >
        		<DataTemplate>
        			<Grid Background="Transparent" Tap="Element_Tap">
        				<Grid.ColumnDefinitions>
        					<ColumnDefinition Width="100"/>
        					<ColumnDefinition/>
        				</Grid.ColumnDefinitions>
        				<Border BorderBrush="Black" BorderThickness="2" CornerRadius="0,40,40,0" OpacityMask="Black">
        					<Border.Background>
        						<ImageBrush Stretch="Fill" ImageSource="{Binding Image, Mode=TwoWay}" />
        					</Border.Background>
        				</Border>
        				<Border BorderBrush="Black" BorderThickness="2" Grid.Column="1" CornerRadius="40,0,0,40" Background="#8C000000">
        					<Grid>
        						<Grid.RowDefinitions>
        							<RowDefinition Height="34"/>
        							<RowDefinition Height="0.482*"/>
        							<RowDefinition Height="0.518*"/>
        							<RowDefinition Height="34"/>
        						</Grid.RowDefinitions>
        						<Grid.ColumnDefinitions>
        							<ColumnDefinition Width="32"/>
        							<ColumnDefinition/>
        						</Grid.ColumnDefinitions>
        						<TextBlock x:Name="tbxNome" Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" TextAlignment="Center" Text="{Binding Nome, Mode=TwoWay}" FontSize="26.667" />
        						<TextBlock x:Name="tbxCognome" Grid.Column="1" Grid.Row="2" TextWrapping="Wrap" TextAlignment="Center" Text="{Binding Cognome, Mode=TwoWay}" FontSize="26.667"/>
        					</Grid>
        				</Border>
        			</Grid>
        		</DataTemplate>
        	</ListBox.ItemTemplate>
        </ListBox>
        <TextBox x:Name="tbxSearch" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Bottom" d:LayoutOverrides="Width" InputScope="PersonalFullName" VerticalScrollBarVisibility="Disabled" TextChanged="tbxSearch_TextChanged" />
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Minimized">
            <shell:ApplicationBarIconButton IconUri="/icons/appbar.add.rest.png" Text="Nuova" Click="BtnAdd_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>